package com.dianxin.smartpark.web.order;

import java.util.List;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.chinatelecom.response.common.CommonResponseBody;
import com.dianxin.smartpark.dao.qo.order.SmartParkOrderRecordQO;
import com.dianxin.smartpark.dao.qo.property.SmartParkPropertyQO;
import com.dianxin.smartpark.service.order.SmartParkOrderRecordService;
import com.dianxin.smartpark.service.vo.order.SmartParkOrderHandleVO;
import com.dianxin.smartpark.service.vo.order.SmartParkOrderRecordVO;
import com.dianxin.smartpark.service.vo.property.SmartParkPropertyVO;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 工单处理记录
 * 
 * @author chenjiasong
 * @date 2021-07-22
 */
@RestController
@RequestMapping("/smartpark/record")
public class SmartParkOrderRecordController
{
    @Resource
    private SmartParkOrderRecordService smartParkOrderRecordService;

    /**
     * 查询工单处理记录列表
     */
    @GetMapping("/list")
    @SaCheckPermission(value = "/smartpark/record/list")
    public CommonResponseBody<List<SmartParkOrderRecordVO>>  list(SmartParkOrderRecordQO qo)
    {
        return smartParkOrderRecordService.selectSmartParkOrderRecordList(qo);
    }

    /**
     * 查询物业工单列表
     */
    @GetMapping("/property/list")
    @SaCheckPermission(value = "/smartpark/record/property/list")
    public CommonResponseBody<List<SmartParkPropertyVO>> propertylist(SmartParkPropertyQO qo)
    {
        return smartParkOrderRecordService.selectSmartParkPropertyList(qo);
    }

    /**
     * 处理工单
     */
    @PutMapping("/handle/order")
    @SaCheckPermission(value = "/smartpark/record/handle/order")
    public  CommonResponseBody<Boolean> handleOrder(@RequestBody SmartParkOrderHandleVO vo)
    {
        return smartParkOrderRecordService.handleOrder(vo);
    }


}
